B Binance · The world's largest crypto exchangeBinance Sign up → AD OKX OKX · A leading global crypto exchangeOKX Sign up → AD

JSON Formatter

Paste JSON and it is indented instantly; syntax errors are reported with their position. Nothing leaves your browser.

Raw JSON (paste here)
Formatted JSON
// Waiting for input...

What this tool does

Paste minified or single-line JSON and it is expanded with four-space indentation as you type, and checked for valid syntax. A success or failure badge and the line count of the result appear above it, and the tidy result copies with one button. Use it to inspect API responses, logs and config files.

How it is calculated

Every time the input changes, the browser's built-in JSON reader parses the text and, on success, the same built-in feature writes it back with four-space indentation. The result turns green, the status badge switches to valid and the lines are counted. On failure the panel turns red and shows the error message exactly as the browser returned it. For example, {"a":1,"b":[2,3]} becomes a seven-line result: the braces, "a": 1, "b": [, 2, 3 and the closing bracket each on their own line. Leading and trailing whitespace is ignored, and clearing the input returns to the waiting state. The tool's code contains nothing that sends data out; everything happens in the browser.

Things to know

Frequently asked questions

What does an 'Unexpected token' error mean?

A character appears where it is not allowed. The usual causes are a trailing comma after the last item, single quotes instead of double quotes, or an unquoted key.

Is what I paste sent to a server?

The tool's code parses it only in your browser and sends it nowhere. If it contained auth tokens, still clear the input when finished on a shared computer.

Can it minify or sort keys?

No. It only expands with four-space indentation and checks syntax; there is no minify or key-sorting feature.

Non-Latin text shows as \uXXXX in my source. Will the result look the same?

Your source was escaped that way. Parsing restores the real characters, so the result shows readable text.

📚 Worth reading
💻AI Coding Assistants: Security and Licence Risks→ 🔐What to check before using an online tool→ 🧰Free Web Tools→ 🎨What HEX, RGB and HSL each mean→